home *** CD-ROM | disk | FTP | other *** search
- -------------------------------------------------------------------
- - SCARD C, C++ Sample Code -
- - ⌐ 98 TOWITOKO electronics GmbH, Munich -
- -------------------------------------------------------------------
-
- The following code will show the recommended import syntax.
- SCARD should be loaded dynamically, please do not use any
- LIB-Import files:
-
- //-----------------------------------------------------------------
- HINSTANCE hDll;
- long (__stdcall * SCardComand)(long *handle, char *Cmd, long *CmdLen, char *DataIn, long *DataInLen, char *DataOut, long *DataOutLen);
- long CmdLen,DataInLen,DataOutLen;
- char *Cmd,*DataIn,*DataOut;
- void test()
- {
- hDll=LoadLibrary("scard32.dll");
- if(hDll!=NULL)
- {
- SCardComand=(long (__stdcall * )(long *handle, char *Cmd, long *CmdLen, char *DataIn, long *DataInLen, char *DataOut, long *DataOutLen))GetProcAddress(hDll,"SCardComand");
-
- Cmd=(char*)malloc(255);
- DataIn=(char*)malloc(255);
- DataOut=(char*)malloc(255);
- long ret;
- strcpy(Cmd,"System,Info");
- strcpy(DataIn,"");
- strcpy(DataOut,"");
- CmdLen=11;
- DataInLen=0;
- DataOutLen=254;
- long handle=0;
- ret=SCardComand(&handle,Cmd,&CmdLen,DataIn,&DataInLen,DataOut,&DataOutLen);
- CString text;
- text.Format("System,Info liefert %d und %s",ret,DataOut);
- MessageBox(NULL,text,text,MB_APPLMODAL);
- }
- }
- //-----------------------------------------------------------------
-
-
-
-
- -------------------------------------------------------------------
- - ⌐ 1998 TOWITOKO electronics GmbH -
- - Rotwandweg 3 -
- - D-82024 Taufkirchen/Munich -
- - GERMANY -
- - http://www.towitoko.com -
- - http://www.towitoko.de -
- - email: support@towitoko.de -
- -------------------------------------------------------------------
-
-